<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMoviesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('movies', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('名称');
            $table->string('cover')->comment('封面')->nullable();
            $table->json('ourther_name')->nullable()->comment('别名 / 其他名称');
            $table->text('introduction')->comment('简介')->nullable();
            $table->string('area')->comment('地区')->nullable();
            $table->json('date')->comment('上映时间')->nullable();
            $table->float('score')->default('0.0')->comment('评分');
            $table->integer('score_people')->unsigned()->default(0)->comment('评分人数');
            $table->integer('runtime')->unsigned()->default(0)->comment('时长');
            $table->string('language')->default('汉语普通话')->comment('语言');
            $table->string('imdb')->nullable()->comment('IMDb 链接');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('movies');
    }
}
